package com.itheima.job;

import java.time.format.DateTimeFormatter;
import java.util.Date;
import java.util.Random;

public class TestDemo3 {
    public static void main(String[] args) {
        System.out.println(getCaptcha());
    }

    public static StringBuilder getCaptcha() {
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < 10; i++) {
            sb.append(i);
        }
        for (char i = 'a'; i < 'z'; i++) {
            sb.append(i);
        }
        for (char i = 'A'; i < 'Z'; i++) {
            sb.append(i);
        }
        System.out.println(sb);
        Random r = new Random();
        StringBuilder captcha = new StringBuilder();
        for (int i = 0; i < 4; i++) {
            int j = r.nextInt(sb.length());
            captcha.append(sb.charAt(j));
        }
        return captcha;
    }
}
